package com.itheima;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;

/**
 * @author chencfgs
 * @date 2019-12-05 10:06
 */
public class DemoDataListener extends AnalysisEventListener<Student> {

    private List<Student> students = new ArrayList<>();

    public List<Student> getStudents() {
        return students;
    }

    @Override
    public void invoke(Student student, AnalysisContext analysisContext) {
        students.add(student);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("所有数据解析完成");
    }
}
